package com.qingmeng.apiinterface;

import com.qingmeng.apiclientsdk.entry.User;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/name")
public class NameController {

    @GetMapping("/get")
    public String getNameByGet2(String name){
        return "你的名字是：" + name;
    }

    @PostMapping("/post")
    public String getNameByPost2(@RequestParam String name){
        return "你的名字是：" + name;
    }

    @PostMapping("/json")
    public String getNameByJson2(@RequestBody User user){
        System.out.println(user.getUserName());
        return "你的名字是：" + user.getUserName();
    }

}
